<template>
<!-- Grace评分 -->
    <div>
        <div class="header">
            <image :src="titleleftimg" class="header-left-img" @click="pageControl.finish()"/>
            <div class="header-center"><text class="header-text">Grace评分</text></div>
            <div class="header-right" @click="pageControl.saveData"  v-if="canSave"><text class="header-right-text">保存</text></div>
            <div class="header-right-s" v-if="! canSave"></div>
        </div>
        <div style="flex-direction: row;margin-top: 15px">
            <div style="flex-direction: column;flex: 1;justify-content: flex-start;margin-left: 30px;margin-right: 70px">
                <div class="selectbox" @click="pageControl.selectOption(0)">
                    <text class="selectbox-left-text">年龄（岁）</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{ageArr[ageKey]}}</text>
                        <image class="selectbox-input-box-img" src="choose_img.png"></image>
                    </div>
                    <text class="selectbox-right-text">{{ageNum[ageKey]}}分</text>
                </div>

                <div class="selectbox" @click="pageControl.selectOption(1)">
                    <text class="selectbox-left-text">心率</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{xinlvArr[xinlvKey]}}</text>
                        <image class="selectbox-input-box-img" src="choose_img.png"></image>
                    </div>
                    <text class="selectbox-right-text">{{xinlvNum[xinlvKey]}}分</text>
                </div>

                <div class="selectbox" @click="pageControl.selectOption(2)">
                    <text class="selectbox-left-text">收缩压</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{ssyaArr[ssyaKey]}}</text>
                        <image class="selectbox-input-box-img" src="choose_img.png"></image>
                    </div>
                    <text class="selectbox-right-text">{{ssyaNum[ssyaKey]}}分</text>
                </div>

                <div class="selectbox" @click="pageControl.selectOption(3)">
                    <text class="selectbox-left-text">肌酐</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{jiganArr[jiganKey]}}</text>
                        <image class="selectbox-input-box-img" src="choose_img.png"></image>
                    </div>
                    <text class="selectbox-right-text">{{jiganNum[jiganKey]}}分</text>
                </div>
                <div class="selectbox" @click="pageControl.selectOption(4)">
                    <text class="selectbox-left-text">Killip分级</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{killipArr[killipKey]}}</text>
                        <image class="selectbox-input-box-img" src="choose_img.png"></image>
                    </div>
                    <text class="selectbox-right-text">{{killipNum[killipKey]}}分</text>
                </div>

                <div class="selectbox" >
                    <text class="selectbox-left-text">Grace分值</text>
                    <div class="selectbox-input-box">
                        <text class="selectbox-input-box-text">{{EmergenModel.GRACE_VALUE}}</text>
                        <text style="font-size: 12px;color: #666666;margin-right: 10px">分</text>
                    </div>
                    <text class="selectbox-right-text"></text>
                </div>
            </div>

            <div style="flex-direction: column;flex: 1">
                <div class="checkbox-max" :class="[EmergenModel.IS_ARREST==1?'box-active':'']" @click="pageControl.check(0)">
                    <text class="checkbox-text" :class="[EmergenModel.IS_ARREST==1?'box-text-active':'']">入院时心脏骤停</text>
                </div>
                <div class="checkbox-max mt-10" :class="[EmergenModel.IS_CHANGE==1?'box-active':'']" @click="pageControl.check(1)">
                    <text class="checkbox-text" :class="[EmergenModel.IS_CHANGE==1?'box-text-active':'']">心电图ST段改变</text>
                </div>
                <div class="checkbox-max mt-10" :class="[EmergenModel.IS_RISE==1?'box-active':'']" @click="pageControl.check(2)">
                    <text class="checkbox-text" :class="[EmergenModel.IS_RISE==1?'box-text-active':'']">心肌坏死标志物升高</text>
                </div>
            </div>
        </div>
        <div style="margin-left: 30px;flex-direction: row;justify-content: flex-start;align-items: center">
            <div class="title"><text class="box-text">危险分层:</text></div>
            <!--<div class="checkbox" :class="[EmergenModel.RISK_LAMINATION==1?'box-active':'']" @click="pageControl.graceType(1)">-->
            <!--<text class="checkbox-text" :class="[EmergenModel.RISK_LAMINATION==1?'box-text-active':'']">极高危</text>-->
            <!--</div>-->
            <div class="checkbox mf-10" :class="[EmergenModel.RISK_LAMINATION==2?'box-active':'']">
                <text class="checkbox-text" :class="[EmergenModel.RISK_LAMINATION==2?'box-text-active':'']">高危</text>
            </div>
            <div class="checkbox mf-10" :class="[EmergenModel.RISK_LAMINATION==3?'box-active':'']">
                <text class="checkbox-text" :class="[EmergenModel.RISK_LAMINATION==3?'box-text-active':'']">中危</text>
            </div>
            <div class="checkbox mf-10" :class="[EmergenModel.RISK_LAMINATION==4?'box-active':'']">
                <text class="checkbox-text" :class="[EmergenModel.RISK_LAMINATION==4?'box-text-active':'']">低危</text>
            </div>
        </div>
    </div>
</template>
<script>
    import Resource from "../../../dist/res/Resource";
    import EMNewMainGraceControl from "./EMNewMainGraceControl";

    export default {
        name: 'EMNewMainEditInfo',
        data: function () {   
            return {
                titleleftimg:"title_cha_img.png",
                pageControl:"",
                currentTab: 0,
                ageArr: ['<30', '30-39', '40-49', '50-59', '60-69', '70-79', '80-89'],
                ageNum: [0, 8, 25, 41, 58, 75, 91],
                ageKey: 0,
                xinlvArr: ['<50', '50-69', '70-89', '90-109', '110-149', '150-199', '≥200'],
                xinlvNum: [0, 3, 9, 15, 24, 38, 46],
                xinlvKey: 0,
                ssyaArr: ['<80', '80-99', '100-119', '120-139', '140-159', '160-199', '≥200'],
                ssyaNum: [58, 53, 43, 34, 24, 10, 0],
                ssyaKey: 0,
                jiganArr: ['0-0.39', '0.4-0.79', '0.8-1.19', '1.2-1.59', '1.6-1.99', '2.0-3.99', '≥4'],
                jiganNum: [1, 4, 7, 10, 13, 21, 28],
                jiganKey: 0,
                killipArr: ['Ⅰ', 'Ⅱ', 'Ⅲ', 'Ⅳ'], // 'Ⅴ', 'Ⅵ'
                killipNum: [0, 20, 39, 59],
                killipKey: 0,
                selectNum: 39,
                select2Num: 28,
                select3Num: 14,
                EmergenModel: {
                    ageKey:0,
                    xinlvKey: 0,
                    ssyaKey: 0,
                    jiganKey: 0,
                    killipKey: 0,
                    IS_ARREST: 0,
                    IS_CHANGE: 0,
                    IS_RISE: 0,
                    RISK_LAMINATION: '',
                    GRACE_VALUE: ''
                },
                canSave:true
            }                                                     
        },
        mounted:function () {
            let instance = this;
            instance.pageControl =
                new EMNewMainGraceControl(instance);
        }
    }
</script>
<style>
    .header {
        height: 40px;
        background-color: #FFF;
        display: flex;
        flex-direction: row;
        justify-content: space-between;    
        align-items: center;
        border-bottom-style: solid;
        border-bottom-width: 0.5px;
        border-bottom-color: #f2f2f2;
    }
    .header-left {
        margin-left: 20px;
    }
    .header-left-img {
        width: 30px;
        height: 30px;
        margin-left: 10px;
    }
    .header-right {
        width: 80px;
        height: 25px;
        background-color: #4c7fd8;
        margin-right: 20px;  
        border-radius: 2px;     
    }
    .header-right-s {
        width: 80px;
        height: 25px;
        margin-right: 20px;
        border-radius: 2px;
    }
    .header-text {
        font-size: 13px;
        color: #666;
    }
    .header-right-text {
        font-size: 13px;
        color: #FFF;
        text-align: center;
        line-height: 25px;       
    }
    .banner-tab {  
        width: 750px;      
        height: 30px;
        display: flex;
        flex-direction: row;
        align-items: center;
        border-bottom-style: solid;
        border-bottom-width: 1px;
        border-bottom-color: #f2f2f2;
        padding-left: 5px;
        padding-right: 5px;              
    }
    .tab {
        width: 80px;
        height: 30px;
        display: flex;
        justify-content: center; 
        margin-left: 5px;
        margin-right: 5px;
        border-bottom-style: solid;
        border-bottom-width: 0;
        border-bottom-color: #FFF;
    }
    .tab-text {
        text-align: center;
        font-size: 12px;
        color: #666;
    }
    .tab-active {
        border-bottom-style: solid;
        border-bottom-width: 2px;
        border-bottom-color: #4c7fd8;
    }
    .content {
        padding-left: 40px;
        padding-right: 40px;
        padding-top: 10px;
        padding-bottom: 20px;
        box-sizing: border-box;
    }
    .box {
        flex: 1;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;   
        height: 40px;
        align-items: center;
    }

    .box-text {
        font-size: 12px;
        color: #666;
    }
    .line {
        flex: 1;
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        box-sizing: border-box;
        margin-right: 100px;
    }

    .title {
        width: 80px;
    }

    .input {
        position: relative;
        flex: 1;
        box-sizing: border-box;
        padding-left: 8px;
        height: 25px;       
        border-radius: 5px;
        border-style: solid;
        border-width: 1px;
        border-color: #b1b1b1;
    }
    .input-text {  
        color: #666;
        line-height: 22px;     
        font-size: 12px;
    }

    .checkbox {
        width: 87px;
        height: 25px;
        background-color: #f2f2f2;
        border-radius: 3px;        
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .checkbox-max {
        width: 140px;
        height: 25px;
        background-color: #f2f2f2;
        border-radius: 3px;        
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .checkbox-text {
        font-size: 12px;
        color: #666;
    }   
    .mf-10 {
        margin-left: 10px;
    }
    .mt-10{
        margin-top: 10px;
    }
    .box-active {
        background-color: #4c7fd8;
    }
    .box-text-active {
        color: #FFF;
    }
    .selectbox{
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        margin-bottom: 10px;
    }
    .selectbox-left-text{
        font-size: 12px;
        color: #666666;
        width: 70px;
    }
    .selectbox-input-box{
        flex: 1;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        height: 25px;
        border-radius: 5px;
        border-style: solid;
        border-width: 1px;
        border-color: #b1b1b1;
    }
    .selectbox-input-box-text{
        flex:1;
        margin-left: 5px;
        font-size: 12px;
        color: #666666;
    }
    .selectbox-input-box-img{
        width: 9px;
        height:16px;
        margin-right: 10px;
    }
    .selectbox-right-text{
        font-size: 10px;
        color: #999999;
        margin-left: 5px;
        width: 40px;
    }
</style>

